package com.liangjie.tagdemo;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public class HelloWorldTag extends SimpleTagSupport {

	@Override
	public void doTag() throws JspException, IOException {
		getJspContext().getOut().write(
				"<h1 style='color:red; background-color:black'>Hello World!<br/>"
						+ new SimpleDateFormat("yyyy-mm-dd HH:MM:ss")
								.format(new Date()) + "</h1>");
	}

}
